using System;
using System.Collections.Generic;
using System.Text;

using System.Xml;

namespace Winsmarts.PI.Common
{
    public class Mapping
    {
        private string inputField = String.Empty;
        private string mossField = String.Empty;
        private string dateFormat = String.Empty;

        public string DateFormat
        {
            get { return dateFormat; }
        }
	
        public bool IsDate
        {
            get { return (dateFormat.Length != 0); }
        }
	
        public string MOSSField
        {
            get { return mossField; }
            set { mossField = value; }
        }

        public string InputField
        {
            get { return inputField; }
        }

        internal Mapping(XmlNode mappingNode)
        {
            inputField = mappingNode.Attributes["InputField"].Value;
            mossField = mappingNode.Attributes["MOSSField"].Value;
            if (mappingNode.Attributes["DateFormat"] != null)
                dateFormat = mappingNode.Attributes["DateFormat"].Value;
        }
    }
}